{include file="public/header"/}
{include file="public/menu"/}
<div class="page-content">
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="{:Url('index/index')}">首页</a>
            <a>
              <cite>分组列表</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" action="">
                        <div class="layui-input-inline layui-show-xs-block">
                            <input style="width:240px" class="layui-input" placeholder="分组名" name="keyword"></div>
                        <div class="layui-input-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i>搜索</button>
                        </div>
                    </form>
                </div>
<!--                <div class="layui-card-header">-->
<!--                    <button class="layui-btn" onclick="xadmin.open('简易模式','{:Url(\'group/add_easy\')}',800,650)">-->
<!--                        <i class="layui-icon"></i>简易模式</button>-->
<!--                    <button class="layui-btn" onclick="xadmin.open('添加分组','{:Url(\'group/add_group\')}',800,650)">-->
<!--                        <i class="layui-icon"></i>添加分组</button>-->
<!--                </div>-->
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>分组名</th>
                            <th>支付方式</th>
                            <th>会员数量</th>
                            <th>创建时间</th>
                            <th width="auto">操作</th>
                        </thead>
                        <tbody>
                        {volist name='list' id='vo'}
                        <tr>
                            <td>{$vo['id']}</td>
                            <td>{$vo['name']}</td>
                            <td>{$vo['pay']}</td>
                            <td>{$vo.id|group_num}</td>
                            <td>{$vo.create_time|toDate}</td>
                            <td class="td-status">
<!--                                <a onclick="xadmin.open('编辑','{:Url(\'group/edit\',[\'id\'=>$vo.id])}',700,600)"class="layui-btn" role="button" data-toggle="modal" >编辑</a>-->
                                <a onclick="xadmin.open('用户','{:Url(\'group/add_user\',[\'id\'=>$vo.id])}',700,600)"class="layui-btn layui-btn-normal" role="button" data-toggle="modal" >用户</a>
<!--                                <a onclick="xadmin.open('模板','{:Url(\'group/add_mode\',[\'id\'=>$vo.id])}',700,700)"class="layui-btn layui-btn-warm" role="button" data-toggle="modal" >模板</a>-->
<!--                                <a class="layui-btn layui-btn-danger" onClick="del_group({$vo.id})">删除</a>-->
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                            <td colspan="10">{$pages|raw}</td>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
{include file="public/footer"/}

<script>
    function del_group(id){
        layer.confirm("确认要删除吗，删除后不能恢复",{ title: "删除确认" },function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('group_del')}",
                data: {
                    'id': id,
                },
                success:function (e) {
                    if (e.code === 1) {
                        layer.msg(e.msg, {
                            time: 2000,
                            end: function () {
                                location.reload();
                            }
                        });
                    } else {
                        layer.msg(e.msg, function () {
                            return false;
                        });
                    }
                }
            });
        },function(){});
    }
</script>